#!/bin/bash

# Ubuntu16.04-配置CUDA9.0+CUDNN1.17+Python升级TENSORFLOW
# https://zhuanlan.zhihu.com/p/103466293

# 新建用户
# https://www.linuxidc.com/Linux/2016-06/132218.htm
# 修改启动顺序
# sudo vim /etc/default/grub
# #grub_defult = 4
# sudo update-grub

# update and remove
sudo apt-get update
sudo apt-get upgrade
sudo apt remove thunderbird totem rhythmbox empathy brasero simple-scan gnome-mahjongg aisleriot gnome-mines transmission-common gnome-orca gnome-sudoku onboard deja-dup bluez 
sudo apt-get autoremove

# terminal everywhere
sudo apt-get install nautilus-open-terminal

# c++11
sudo apt-get install gcc g++

# time locally
timedatectl set-local-rtc 1

# git & cmake install 
sudo apt install git
sudo apt install cmake

# vim install & configure
sudo apt-get install vim
wget -qO- https://raw.github.com/ma6174/vim/master/setup.sh | sh -x

# vscode install
sudo snap install --classic code
# download deb from https://code.visualstudio.com/Download
# sudo dpkg -i code_1.37.0-1565227985_amd64.deb


# # 配置git
# git config --global user.name JingruiYu
# git config --global user.email yujingrui@sjtu.edu.cn
# ssh-keygen -t rsa -C "yujingrui@sjtu.edu.cn"
# cd .ssh/
# code id_rsa.pub
# # ssh -T git@github.com
# #https://blog.csdn.net/Rookie_tong/article/details/82628301

# 美化shell
## https://blog.csdn.net/iweaming/article/details/49786725
## 1
# parse_git_branch() {
#     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
# }
# # PS1="\[\033[0;37m\]\A \[\033[01;96m\]\u\[\033[0;34m\]@\[\033[01;96m\]\h\[\033[0;34m\]: \[\033[00;32m\]\w\[\033[0;32m\]-branch:\[\033[31m\]$(parse_git_branch)\[\033[33m\] $\[\033[0m\] \n \[\033[32m\]>> \[\033[0;37m\]"
# PS1='${debian_chroot:+($debian_chroot)}\[\033[0;33m\][$(date +%H:%M:%S)] \u@\h\[\033[0;36m\]: \[\033[0;32m\]\w\[\033[0m\]\[\033[0;31m\]-branch:$(parse_git_branch)\[\033[0m\] \n>> '
# unset color_prompt force_color_prompt
## 2
# parse_git_branch() {
#     git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
# }
# # PS1='\[\033[0;31m\]\342\224\214\342\224\200$([[ $? != 0 ]] && echo "[\[\033[0;31m\]\342\234\227\[\033[0;37m\]]\342\224\200")[\[\033[0;39m\]\u\[\033[01;33m\]@\[\033[01;96m\]\h\[\033[0;31m\]]\342\224\200[\[\033[0;32m\]\w\[\033[0;31m\]]\n\[\033[0;31m\]\342\224\224\342\224\200\342\224\200\342\225\274 \[\033[0m\]\[\e[01;33m\]\$\[\e[0m\]'
# PS1="\[\033[0;37m\]\A \[\033[01;96m\]\u\[\033[0;34m\]@\[\033[01;96m\]\h\[\033[0;34m\]: \[\033[00;32m\]\w\[\033[0;32m\]-branch:\[\033[31m\]$(parse_git_branch)\[\033[33m\] $\[\033[0m\] \n \[\033[32m\]>> \[\033[0;37m\]"
